CQCC in Python

Input Signal

in some python file they use librosa to read sound files

In my feature extraction code, they used soundfile to read, so i used that here for fair comparison, but both give same result

Parameters

Same parameters are used in matlab code

Compute CQCC Features

The cqcc function return 7 results, I used 'CQcc' for Model building, so did the Baseline paper, and the python converted code in model building paper.

CQCC in Matlab

I ran the cqcc code in matlab and saved each result from cqcc function in a text file.

'Ures_FreqVec_test.txt' -> I removed this result, because python version returns nothing in this variable.

Regex to clean data, some rows had '\n' in them

Helper functions

extract_from_matlab: This function reads txt files generated by matlab and saves them in ndarrays. plt_heatmap: to plot heatmap of a single feature

NOTE: 2 results returned from matlab are transposed, when comparing there shape with python features

transposing them so the shape matches the features from python

Comparing result shapes

heatmaps of all features of a sample file

creating a function that plots all features of file side by side for comparison

selecting random files from training data to compare

ran matlab code on these files and saved features in txt files

Visually, CQCC and Ures LogP abs CQT are very different, rest of them look very similar.

Checking difference between each feature, and plotting the heatmap.

Checking if Feature extraction process is deterministic, Python

i.e if we extract feature from same file multiple times, do they change or are they always same.

Checking if deterministic in MATLAB